import { useStore } from '@/store';

// 传入pageName, handleName(query,add,delete,update)
export function usePermission(pageName: string, handleName: string) {
  const store = useStore();
  const permissions = store.state.loginModule.userBtnPermissions;
  const verifyPermission = `system:${pageName}:${handleName}`;
  return !!permissions.find((item) => item === verifyPermission);
}
